<template>
 <div>
    <el-date-picker
      v-model="item.startTime"
      @change="change"
      :clearable="false"
      :editable="false"
      :picker-options="{
        firstDayOfWeek:1
      }"
      type="week"
      format="yyyy 第 WW 周"
      placeholder="选择周">
    </el-date-picker>
 </div>
</template>
<script>
export default {
  data() {
    return {
      item: {
        startTime: '',
        endTime: ''
      }
    };
  },
  methods: {
    change(val) {
      // this.item.startTime = val + '-01 00:00:00';
      // this.$emit('change', this.item);
    },
    changeEndTime(val) {
      // this.item.endTime = this.$moment(val).endOf('month').format('YYYY-MM-DD') + ' 23:59:59';
      // this.$emit('change', this.item);
    }
  },
  created() {
    // this.item = Object.assign(this.item, JSON.parse(JSON.stringify(this.$attrs)));
    // this.item.startTime = this.item.startTime || this.$moment().subtract(1, 'months').startOf('month').format('YYYY-MM-DD') + ' 00:00:00';
    // this.item.endTime = this.item.endTime || this.$moment().endOf('month').format('YYYY-MM-DD') + ' 23:59:59';
    // this.$emit('change', this.item);
  }
};
</script>